//
//  BaseModel.m
//  VariousPlay
//
//  Created by dllo on 15/12/21.
//  Copyright © 2015年 wangjingbo. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel
//封装的思想:把给初始化model和给model赋值写到封装到一起
//把setValuesForKey分装起来
- (instancetype)initWithDictionary:(NSDictionary *)dictionary{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
//封装初始化model:调用上面的方法实现setValueforkey+初始化
+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary{
    return [[self alloc]initWithDictionary:dictionary];
}
@end
